Acrobat Reader ActiveX in WebBrowser stealing focus [C#]

Posted by Maciej on Stack Overflow See other posts from Stack Overflow or by Maciej
Published on 2010-03-22T08:23:50Z Indexed on 2010/03/23 8:53 UTC
Read the original article Hit count: 1075

Filed under:
|
|
|

I'm using webBrowser.Navigate(url) control to display page.
I noticed this action steals focus from current control (grid) and than I have problem to focus grid back (tired myGrid.Focus, .Select etc...)
This is really annoying behaviour of browser...

Does anyone knows how to prevent focus stealing by Browser or (if not) hot to force to focus control back ?

EDIT:
I've also tried webBrowser.DocumentCompleted event to focus back to grid

EDIT 2
Good case to test this is openning PDF files webBrowser.Navigate(@"C:\TEMP\test.pdf")
I believe this is ActiveX issue. On first glance it looks that this is not problem with focusing control but loosing entire Form focus...

EDIT 3
I tried another approach: Form keyPress event: I thought I can capture form's keyPress and move focus from WebBrowser / AdobeReader ActiveX to my control. But surprisingly event is not fired! Looks Reader taken all control and there is no way to do anything programically until you do mouse click on (at least) form's caption

Any advice (s) ?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about winforms